package com.sys.orders.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.sys.common.pojo.BasePojo;

/**
 * 订单表
 * 
 * @author lby
 *
 */
public class AOrdersDesc extends BasePojo<AOrdersDesc>
{
	private int orderId;
	private int userId;
	private int addressId;
	private Date orderDate;
	private double orderAmount;
	private byte orderStatus;
	private Date completionTime;
	private String consigneeTelephone;
	private String consigneeName;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;

	private String orderStatusStr;

	private Map<String, String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		AOrdersDescEnum[] aordersgoodsenum = AOrdersDescEnum.values();
		for (int i = 0; i < aordersgoodsenum.length; i++)
		{
			AOrdersDescEnum aordersgoodsEnum = aordersgoodsenum[i];
			String key = aordersgoodsEnum.toString();
			enumsMap.put(key + "-" + aordersgoodsEnum.getStatus() + "", aordersgoodsEnum.getName());
		}
		return enumsMap;
	}

	public String getOrderStatusStr()
	{
		AOrdersDescEnum[] values = AOrdersDescEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AOrdersDescEnum aordersgoodsEnumTemp = values[i];
			if (aordersgoodsEnumTemp.toString().startsWith("STATUS_"))
			{
				if (aordersgoodsEnumTemp.getStatus() == this.orderStatus)
				{
					this.orderStatusStr = aordersgoodsEnumTemp.getName();
				}
			}
		}

		return orderStatusStr;
	}

	public int getOrderId()
	{
		return orderId;
	}

	public void setOrderId(int orderId)
	{
		this.orderId = orderId;
	}

	public int getUserId()
	{
		return userId;
	}

	public void setUserId(int userId)
	{
		this.userId = userId;
	}

	public int getAddressId()
	{
		return addressId;
	}

	public void setAddressId(int addressId)
	{
		this.addressId = addressId;
	}

	public Date getOrderDate()
	{
		return orderDate;
	}

	public void setOrderDate(Date orderDate)
	{
		this.orderDate = orderDate;
	}

	public double getOrderAmount()
	{
		return orderAmount;
	}

	public void setOrderAmount(double orderAmount)
	{
		this.orderAmount = orderAmount;
	}

	public byte getOrderStatus()
	{
		return orderStatus;
	}

	public void setOrderStatus(byte orderStatus)
	{
		this.orderStatus = orderStatus;
	}

	public Date getCompletionTime()
	{
		return completionTime;
	}

	public void setCompletionTime(Date completionTime)
	{
		this.completionTime = completionTime;
	}

	public String getConsigneeTelephone()
	{
		return consigneeTelephone;
	}

	public void setConsigneeTelephone(String consigneeTelephone)
	{
		this.consigneeTelephone = consigneeTelephone;
	}

	public String getConsigneeName()
	{
		return consigneeName;
	}

	public void setConsigneeName(String consigneeName)
	{
		this.consigneeName = consigneeName;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

}
